package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.constant.MessageConstant;
import com.itheima.entity.PageResult;
import com.itheima.entity.QueryPageBean;
import com.itheima.entity.Result;
import com.itheima.pojo.Log;
import com.itheima.service.AccessLogService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/accessLog")
public class AccessLogController {


    @Reference
    private AccessLogService accessLogService;

    @RequestMapping("/findLogs")
    public Result accessLog(){
        try {


            List<Log> logList =accessLogService.findLogs();
            return new Result(true, MessageConstant.DELETE_ORDERSETTING_SUCCESS,logList);
        } catch (Exception e) {
            return new Result(false, MessageConstant.DELETE_ORDERSETTING_SUCCESS);
        }

    }

}
